package com.evolution.warlock.service.impl;

import java.util.Collection;
import java.util.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.evolution.warlock.Page;
import com.evolution.warlock.Pageable;
import com.evolution.warlock.dao.CriminalBaseDao;
import com.evolution.warlock.entity.CriminalBase;
import com.evolution.warlock.service.CriminalBaseService;

@Service("criminalBaseServiceImpl")
public class CriminalBaseServiceImpl extends BaseServiceImpl<CriminalBase, Long> implements CriminalBaseService{

	@Resource(name = "criminalBaseDaoImpl")
	private CriminalBaseDao criminalBaseDao;
	
	@Resource(name = "criminalBaseDaoImpl")
	public void setBaseDao(CriminalBaseDao criminalBaseDao) {
		super.setBaseDao(criminalBaseDao);
	}	
	
	@Transactional(readOnly = true)
	public Page<CriminalBase> findPage(Pageable pageable, String idCardNum, String name, String criminalCategory, String penaltyCategory, String temporaryGuy, Collection<String> currentArea, Date fromDate, Date toDate){
		return criminalBaseDao.findPage(pageable, idCardNum, name, criminalCategory, penaltyCategory, temporaryGuy, currentArea, fromDate, toDate);
	}

	@Override
	public CriminalBase findCriminalBaseByIdCardNum(String idCardNum) {
		return criminalBaseDao.findCriminalBaseByIdCardNum(idCardNum);
	}

	@Transactional(readOnly = true)
	public CriminalBase findCriminalBase(Long criminalNumber) {
		return criminalBaseDao.findCriminalBase(criminalNumber);
	}
	
	
	
	
}
